package com.aplikata.evok.bo;

import java.util.HashSet;
import java.util.Set;

import com.aplikata.bo.Domain;

/**
 * @ClassName: Service
 * @Description: TODO
 * @author Huyun
 * @date May 25, 2012 11:58:56 AM
 */
public class EvokService implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private Long id;
	private String code;
	private String name;
	private Short unit;
	private Float price;
	private Short currency;
	private String remark;
	private Domain domain;
	private Set<TherapyService> therapyServices = new HashSet<TherapyService>(0);

	public final static String NAME = "name";
	public final static String LB_SERVICE_TITLE = "therapy_service";
	public final static String QY_FIND_BY_DOMAIN = "EvokService.findByDomain";
	
	// Constructors

	/** default constructor */
	public EvokService() {
	}
	
	public EvokService(Domain domain) {
		this.domain = domain;
	}

	// Property accessors

	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Short getUnit() {
		return this.unit;
	}

	public void setUnit(Short unit) {
		this.unit = unit;
	}

	public Float getPrice() {
		return this.price;
	}

	public void setPrice(Float price) {
		this.price = price;
	}

	public Short getCurrency() {
		return this.currency;
	}

	public void setCurrency(Short currency) {
		this.currency = currency;
	}

	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Set<TherapyService> getTherapyServices() {
		return therapyServices;
	}

	public void setTherapyServices(Set<TherapyService> therapyServices) {
		this.therapyServices = therapyServices;
	}

	public Domain getDomain() {
		return domain;
	}

	public void setDomain(Domain domain) {
		this.domain = domain;
	}

	public boolean equals(Object o) {
		if (this == o)
			return true;
		if (o == null)
			return false;
		if (!(o instanceof EvokService))
			return false;
		if (isNew() || ((EvokService) o).isNew())
			return false;
		else
			return getId().equals(((EvokService) o).getId());
	}

	public boolean isNew() {
		return getId() == null;
	}
}